package org.tools.ui.renderer.grid
{
	import mx.controls.Label;
	import mx.core.IDataRenderer;
	import mx.formatters.DateFormatter;

	public class DateFormateRenderer extends Label implements IDataRenderer
	{
		private var _field:String;
		private var dateFormate:DateFormatter = new DateFormatter();
		public function DateFormateRenderer()
		{
			super();
		}
		
		override public function get data():Object
		{
			return super.data;
		}
		
		override public function set data(value:Object):void
		{
			super.data = value;
			text = dateFormate.format(value[_field]);
		}
		
		public function set field(value:String):void
		{
			_field = value;
		}
		
		public function set formateStr(value:String):void
		{
			dateFormate.formatString = value;
		}
		
	}
}